﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PuntoDeVentaList.aspx.cs" Inherits="CrmContacto.WebApp.App.PuntoDeVentaList" %>

<%@ Import Namespace="Web.Framework.Translate" %>

<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    
     <h2 runat="server" id="TitleNavContext" visible="false">
        <asp:Label ID="lblContexto" runat="server" Text="" ></asp:Label>
    </h2>
    <h2>
        <asp:Image Width="15px" Height="15px" ID="imgExpandResults" CssClass="imgExpand"
            ImageUrl="/Images/icon_blockexpanded.png" runat="server" ClientIDMode="Static"
            alt="" onclick="window.AppCommonObj.toggleVisibility(this.id, 'searchBox');" />
        <asp:Literal ID="Literal22" runat="server" Text='<%$ Code: LocalizationProvider.Instance["Bo.PuntoDeVenta.FilterTitle"]%>' />
        <asp:Label ID="lblSearchResult" runat="server" Text="" CssClass="lblSearchResult"></asp:Label>
    </h2>
    <div class="editionContainerFilter" id="searchBox">
        <p>
            <span class="title">
                <asp:Literal ID="Literal2" runat="server" Text='<%$ Code: LocalizationProvider.Instance["ListaDistribucion.Nombre"]%>' />:</span>
            <asp:TextBox ID="txtNombre" runat="server" ClientIDMode="Static" CssClass="inputs inputlong"
                title='<%$ Code: LocalizationProvider.Instance["ListaDistribucion.Nombre"]%>'></asp:TextBox>
        </p>
        <div class="clear">
        </div>    
        <p>
            <span class="title">
                <asp:Literal ID="Literal5" runat="server" Text='<%$ Code: LocalizationProvider.Instance["PuntoDeVenta.Activo"]%>' />:</span>
            <asp:CheckBox ID="chkActivo" CssClass="chk" runat="server" Checked="true" />            
        </p>
        <div class="clear">
        </div>       
        <asp:LinkButton ID="lnkBuscar" runat="server" OnClick="lnkBuscar_Click">
            <asp:Literal ID="Literal3" runat="server" Text='<%$ Code: LocalizationProvider.Instance["Bo.Command.Buscar"]%>' /></asp:LinkButton>
        <a href="#" onclick="javascript:document.forms[0].reset();">
            <asp:Literal ID="Literal4" runat="server" Text='<%$ Code: LocalizationProvider.Instance["Bo.Command.Limpiar"]%>' /></a>
        <div class="clear">
        </div>
    </div>
    <h2>
        <asp:Image Width="15px" Height="15px" ID="Image1" CssClass="imgExpand" ImageUrl="/Images/icon_blockcollapsed.png"
            runat="server" ClientIDMode="Static" alt="" onclick="window.AppCommonObj.toggleVisibility(this.id, 'pnlResults');" />
        <asp:Literal ID="Literal1" runat="server" Text='<%$ Code: LocalizationProvider.Instance["Bo.PuntoDeVenta.FilterResultsTitle"] %>' />
        <asp:Label ID="Label1" runat="server" Text="" CssClass="lblSearchResult"></asp:Label>
    </h2>
    <asp:Panel ID="pnlResults" CssClass="editionContainerForGrid" runat="server" ClientIDMode="Static">
    <asp:HiddenField ID="hidCheckedRows" runat="server" ClientIDMode="Static" />
        <asp:GridView ID="Grid" runat="server" CellPadding="4" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False" DataKeyNames="Id" Width="100%" AllowPaging="False"
            OnPageIndexChanging="Grid_PageIndexChanging" OnRowCommand="Grid_RowCommand"
            OnRowDataBound="Grid_RowDataBound">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="Seleccionar" >
                    <HeaderStyle HorizontalAlign="Center" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server" CssClass="chkSelectRowHeader" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelectRow" runat="server" CssClass="chkSelectRow" onclick="javascript:window.AppCommonObj.HandleCheckRow(this);" />
                    </ItemTemplate>
                </asp:TemplateField>   
                 <asp:TemplateField HeaderText="Id">
                    <HeaderStyle CssClass="displayNone" />
                    <ItemStyle CssClass="displayNone"  />
                    <HeaderTemplate>
                        <span class="displayNone"></span>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input id="hidenInputRowId_<%# Eval("Id")%>" value="<%# Eval("Id")%>" class="gridid" />
                    </ItemTemplate>
                </asp:TemplateField> 
                <asp:ButtonField ButtonType="Image" CommandName="editar" ImageUrl="~/Images/editar.png"
                    Text="Button" AccessibleHeaderText="editar">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:ButtonField>
                <asp:TemplateField HeaderText="">
                    <HeaderStyle HorizontalAlign="Left" Width="30px" />
                    <ItemStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/eliminar.png"
                            CommandName="eliminar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                    </ItemTemplate>
                </asp:TemplateField>                
                <asp:BoundField DataField="Nombre" HeaderText='<%$ Code: LocalizationProvider.Instance["MaestroBase.Nombre"] %>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>   
                  <asp:BoundField DataField="CodigoExterno" HeaderText='<%$ Code: LocalizationProvider.Instance["PuntoDeVenta.CodigoExterno"] %>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>         
                  <asp:CheckBoxField DataField="Activo" HeaderText='<%$ Code: LocalizationProvider.Instance["PuntoDeVenta.Activo"] %>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:CheckBoxField>    
                 <asp:CheckBoxField DataField="Outlet" HeaderText='<%$ Code: LocalizationProvider.Instance["PuntoDeVenta.Outlet"] %>'>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:CheckBoxField>          
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
            <PagerStyle BackColor="#4b6c9e" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
    </asp:Panel>
    <script type='text/javascript'>

        $(document).ready(function () {

            if (!window.AppCommonObj) {
                window.AppCommonObj = new AppCommon();
            }

            window.AppCommonObj.initializeEnterKeyEvent($('#searchBox'), function () {
                __doPostBack($('#lnkBuscar').attr('aspnetid'), '');
            });


            //$('input[title]').inputHints();

        });
    </script>
</asp:Content>

